#include <Windows.h>
#include <extend.h>

LPSTR _u2Hex( WORD wNumber )
{
   return "";
}

//----------------------------------------------------------------------------//

CLIPPER NOR()
{
   LONG lRet = 0;
   WORD i = 0;
   while( i < _pcount() )
        lRet = lRet | _parnl( ++i );

   _retnl( lRet );
}

//----------------------------------------------------------------------------//

CLIPPER NAND()
{
   LONG lRet = -1;
   WORD i = 0;
   while( i < _pcount() )
        lRet = lRet & _parnl( ++i );

   _retnl( lRet );
}

//----------------------------------------------------------------------------//

CLIPPER NNOT()
{
   _retnl( ~_parnl( 1 ) );
}

//----------------------------------------------------------------------------//

CLIPPER LAND()
{
   _retl( ( _parnl( 1 ) & _parnl( 2 ) ) != 0 );
}

//----------------------------------------------------------------------------//

CLIPPER NXOR()
{
   LONG lRet = 0;
   WORD i = 0;
   while ( i< _pcount() )
     lRet = lRet ^ _parnl( ++i );

   _retnl( lRet );
}

//----------------------------------------------------------------------------//

CLIPPER LXOR()
{
   _retl( _parnl( 1 ) ^ _parnl( 2 ) );
}

//----------------------------------------------------------------------------//

CLIPPER NPTRWORD()
{
   _retni( * ( WORD * ) _parnl( 1 ) );
}

//----------------------------------------------------------------------------//

CLIPPER I2HEX() // nValue --> cHexValue
{
   _retc( _u2Hex( _parni( 1 ) ) );
}

//----------------------------------------------------------------------------//

CLIPPER L2HEX() // nValue --> cHexValue
{
   BYTE b[ 8 ];

   _bcopy( b,     _u2Hex( HIWORD( _parnl( 1 ) ) ), 4 );
   _bcopy( b + 4, _u2Hex( LOWORD( _parnl( 1 ) ) ), 4 );

   _retclen( b, 8 );
}

//----------------------------------------------------------------------------//
